//
//  MyBarcodeStoreAppDelegate.m
//  MyBarcodeStore
//
//  Created by Mac on 2010/5/17.
//  Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import "MyBarcodeStoreAppDelegate.h"
#import "BarcodeReader.h"
#import "ViewDBPage.h"
#import "DBNavigationViewController.h"
#import "AdminPage.h"

@implementation MyBarcodeStoreAppDelegate

@synthesize window, tabBarController;


- (void)applicationDidFinishLaunching:(UIApplication *)application {    
	
	//Initilize objects
	tabBarController = [[UITabBarController alloc] init];
	
	navViewDB = [[DBNavigationViewController alloc] init];
	
	brp = [[BarcodeReader alloc] initWithNibName:@"BarcodeReader" bundle:nil];
	
	ap = [[AdminPage alloc] init];
	navAdminPage = [[UINavigationController alloc] initWithRootViewController:ap];
	
	tabBarController.viewControllers = [NSArray arrayWithObjects:navViewDB, brp, navAdminPage, nil];
	
	//Add tabbar to window and display
	[window addSubview:tabBarController.view];
	
    // Override point for customization after application launch
    [window makeKeyAndVisible];
}

- (void)dealloc {
	[tabBarController release];
	[navViewDB release];
	[navAdminPage release];
	[ap release];
	[brp release];
	[vbp release];
    [window release];
    [super dealloc];
}

@end
